

#include <rtthread.h>
#include "extern_flash_read.h"
#include "uc_log.h"

void test_extern_flash_ap_read(void)
{
    int all_len = AP_PARAMENT_SIZE; // 1.2M
    char buf[128] = {0};
    int offset = 0;

    while (offset < all_len)
    {

        if (read_ap_param(offset, buf, 128))
        {
            TRACE_E("read_ap_param");
            return;
        }

        offset += 128;

        for (int i = 0; i < 128; i++)
        {
            rt_kprintf("%02X ", buf[i]);
            if (i % 16 == 0)
            {
                rt_kprintf("\n");
            }
        }
        rt_kprintf("\n");
    }
}

void test_extern_flash_200t_read(void)
{
    int all_len = U200T_PARAMENT_SIZE; // 400k
    char buf[128] = {0};
    int offset = 0;

    rt_kprintf("\n");

    while (offset < all_len)
    {

        if (read_200t_param(offset, buf, 128))
        {
            TRACE_E("read_ap_param");
            return;
        }

        offset += 128;

        for (int i = 0; i < 128; i++)
        {
            if (i % 16 == 0)
            {
                rt_kprintf("\n");
            }
            rt_kprintf("%02X ", buf[i]);
        }
    }
    rt_kprintf("\n");
}